<?php
/**
 * Created by PhpStorm.
 * User: spatra
 * Date: 15-1-8
 * Time: 下午2:22
 */

class Callname_Student extends Eloquent
{
    public function callname_list()
    {
        return $this->belongsTo('Callname_List', 'callname_list_id');
    }

    public static function markAbsentStudents($list_id, $ids)
    {
        return static::where('callname_list_id', $list_id)
            ->whereIn('id', $ids)->increment('absent_times');
    }
    protected $guarded = ['id'];


    protected $table = 'callname_students';
}